import 'package:flutter/material.dart';

class SlideBuiltTransition extends StatelessWidget {
  const SlideBuiltTransition({
    super.key,
    required this.position,
    required this.child,
  });

  final Animation<Offset> position;
  final Widget child;

  @override
  Widget build(BuildContext context) {
    return AnimatedBuilder(
      animation: position,
      child: child,
      builder: (context, child) {
        return FractionalTranslation(
          translation: position.value,
          child: child,
        );
      },
    );
  }
}
